package com.xmut.bs.handaccount.adapter;

import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentManager;
import android.support.v4.app.FragmentPagerAdapter;

import com.xmut.bs.handaccount.fragment.OrderFragment;


public class OrderPagerAdapter extends FragmentPagerAdapter {

    private boolean isManager;

    public OrderPagerAdapter(FragmentManager fm, boolean isManager) {
        super(fm);
        this.isManager = isManager;
    }

    @Override
    public Fragment getItem(int position) {
        // getItem is called to instantiate the fragment for the given page.
        // Return a PlaceholderFragment (defined as a static inner class below).
        return OrderFragment.newInstance(position, isManager);
    }

    @Override
    public int getCount() {
        return 4;
    }

    @Override
    public CharSequence getPageTitle(int position) {
        switch (position) {
            case 0:
                return "全部";
            case 1:
                return "待发货";
            case 2:
                return "待收货";
            case 3:
                return "待评价";
        }
        return null;
    }
}